this.keyboardBox.hide();
let monitor = this.primaryMonitor;
- let x = monitor.x + monitor.width / 2.0;
- let y = monitor.y + monitor.height / 2.0;
- this.uiGroup.set_pivot_point(x / global.screen_width,
- y / global.screen_height);
- this.uiGroup.scale_x = this.uiGroup.scale_y = 0.75;
- this.uiGroup.opacity = 0;
+ if (!Main.sessionMode.hasOverview) {
+ const x = monitor.x + monitor.width / 2.0;
+ const y = monitor.y + monitor.height / 2.0;
+
+ this.uiGroup.set_pivot_point(
+ x / global.screen_width,
+ y / global.screen_height);
+ this.uiGroup.scale_x = this.uiGroup.scale_y = 0.75;
+ this.uiGroup.opacity = 0;
+ }
+
global.window_group.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
await this._updateBackgrounds();
}
_startupAnimationSession() {
- this.uiGroup.ease({
- scale_x: 1,
- scale_y: 1,
- opacity: 255,
- duration: STARTUP_ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- onComplete: () => this._startupAnimationComplete(),
- });
+ const onComplete = () => this._startupAnimationComplete();
+ if (Main.sessionMode.hasOverview) {
+ Main.overview.runStartupAnimation(onComplete);
+ } else {
+ this.uiGroup.ease({
+ scale_x: 1,
+ scale_y: 1,
+ opacity: 255,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete,
+ });
+ }
}
_startupAnimationComplete() {
this._controls.animateFromOverview(callback);
}
+ runStartupAnimation(callback) {
+ this._controls.runStartupAnimation(callback);
+ }
+
get dash() {
return this._controls.dash;
}
this._show(OverviewControls.ControlsState.APP_GRID);
}
+ runStartupAnimation(callback) {
+ this._shown = true;
+ this._visible = true;
+ this._visibleTarget = true;
+ Main.layoutManager.showOverview();
+ this._syncGrab();
+
+ Meta.disable_unredirect_for_display(global.display);
+
+ this.emit('showing');
+
+ this._overview.runStartupAnimation(() => {
+ this.emit('shown');
+ callback();
+ });
+ }
+
getShowAppsButton() {
logError(new Error('Usage of Overview.\'getShowAppsButton\' is deprecated, ' +
'use \'dash.showAppsButton\' property instead'));
const AppDisplay = imports.ui.appDisplay;
const Dash = imports.ui.dash;
+const Layout = imports.ui.layout;
const Main = imports.ui.main;
const Overview = imports.ui.overview;
const SearchController = imports.ui.searchController;
this._dash = dash;
this._cachedWorkspaceBoxes = new Map();
+ this._postAllocationCallbacks = [];
stateAdjustment.connect('notify::value', () => this.layout_changed());
}
return appDisplayBox;
}
+ _runPostAllocation() {
+ if (this._postAllocationCallbacks.length === 0)
+ return;
+
+ this._postAllocationCallbacks.forEach(cb => cb());
+ this._postAllocationCallbacks = [];
+ }
+
vfunc_set_container(container) {
this._container = container;
this.hookup_style(container);
childBox.set_size(width, availableHeight);
this._searchController.allocate(childBox);
+
+ this._runPostAllocation();
+ }
+
+ ensureAllocation() {
+ this.layout_changed();
+ return new Promise(
+ resolve => this._postAllocationCallbacks.push(resolve));
}
getWorkspacesBoxForState(state) {
this._stateAdjustment.gestureInProgress = false;
}
+ async runStartupAnimation(callback) {
+ this._ignoreShowAppsButtonToggle = true;
+
+ this._searchController.prepareToEnterOverview();
+ this._workspacesDisplay.prepareToEnterOverview();
+
+ this._stateAdjustment.value = ControlsState.HIDDEN;
+ this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
+ duration: Overview.ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+
+ this.dash.showAppsButton.checked = false;
+ this._ignoreShowAppsButtonToggle = false;
+
+ // Set the opacity here to avoid a 1-frame flicker
+ this.opacity = 0;
+
+ // We can't run the animation before the first allocation happens
+ await this.layout_manager.ensureAllocation();
+
+ const { STARTUP_ANIMATION_TIME } = Layout;
+
+ // Opacity
+ this.ease({
+ opacity: 255,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.LINEAR,
+ });
+
+ // Search bar falls from the ceiling
+ const { primaryMonitor } = Main.layoutManager;
+ const [, y] = this._searchEntryBin.get_transformed_position();
+ const yOffset = y - primaryMonitor.y;
+
+ this._searchEntryBin.translation_y = -(yOffset + this._searchEntryBin.height);
+ this._searchEntryBin.ease({
+ translation_y: 0,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+
+ // The Dash rises from the bottom. This is the last animation to finish,
+ // so run the callback there.
+ this.dash.translation_y = this.dash.height;
+ this.dash.ease({
+ translation_y: 0,
+ delay: STARTUP_ANIMATION_TIME,
+ duration: STARTUP_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: () => callback(),
+ });
+ }
+
get searchEntry() {
return this._searchEntry;
}